package com.ljq.cksp.controller;

import com.ljq.cksp.dao.LawDao;
import com.ljq.cksp.pojo.Law;
import com.ljq.cksp.pojo.Result;
import com.ljq.cksp.service.LawService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author:ljq
 * @Date:2020/3/3
 */
@RestController
@RequestMapping("/law")
public class LawController {
    @Autowired
    LawService lawService;
    @GetMapping()
    public Result query(String keyword, @RequestParam(value="start", defaultValue="0") int start, @RequestParam(value="size", defaultValue="10") int size){
        Result result = new Result();
        Page<Law> data = lawService.query(keyword, start, size);
        result.setData(data);
        return result;
    }

}
